Disk input/output (I/O) is one of the biggest bottlenecks on a computer platform. Caching of disk drive data in a cache memory offers significantly improved performance, while reducing power consumption of the system, as the associated drive can be kept spun down for longer periods of times. In a writeback cache system write data is written into the cache on operating system (OS) request, and at some later time, the dirty data is written to the disk drive as a so-called lazy write.
Such a disk cache may be maintained physically separate from an associated disk drive such as a hard drive. As an example, the disk cache may be a non-volatile memory coupled to a system motherboard, while the disk drive is a separate physical enclosure, typically connected to the motherboard via a connector and cabling. However, a problem with this approach is that the associated disk drive cannot be removed from the system and used on another system unless the cache is first flushed. Also, such a drive may have a mix of old and new data, and is thus scrambled and unusable on a second system.
Further, if the drive is used on the second system and its data is modified, and then the drive is returned to the original system, the cache then contains stale data and may provide wrong data to the OS responsive to read requests. Such separation scenarios commonly occur, as when a user's system crashes and has hard errors an information technology (IT) person may remove the disk drive from the original system and move it to a different system (e.g., a loaner system) for the user. The user works on the loaner system (thereby modifying data on the disk drive) while the original system is repaired. The drive is later returned to the original system containing the cache. However, the data in the disk cache and disk drive are incoherent, and thus errors are likely to occur.